package com.packer.ext.libdemo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.packer.ext.base.BaseActivity;
import com.packer.ext.libdemo.api.Api;
import com.packer.ext.libdemo.bean.GankData;
import com.packer.ext.rx.RxHelper;
import com.tbruyelle.rxpermissions2.RxPermissions;
import com.tbruyelle.rxpermissions2.RxPermissionsFragment;

import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Consumer;
import io.reactivex.observers.DisposableObserver;
import okhttp3.ResponseBody;

/**
 * ${DESC}
 *
 * @author pengbinghan
 *         created at 2018/4/19
 */
public class MainActivity extends BaseActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new TextView(this));
        Api.getApiService().getData(10,1)
                .compose(RxHelper.<GankData>handleResult(this))
                .subscribe(new DisposableObserver<GankData>() {
                    @Override
                    public void onNext(@NonNull GankData gankData) {

                    }

                    @Override
                    public void onError(@NonNull Throwable throwable) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });

    }
}
